Skip to content

__completion_signatures_of_t requires that get_completion_signatures<S,E...>() is a constant expression#1899

Merged
ericniebler merged 1 commit intoNVIDIA:mainfrom
ericniebler:safer-completion-signatures-of-t
Apr 29, 2026
Merged

__completion_signatures_of_t requires that get_completion_signatures<S,E...>() is a constant expression#1899
ericniebler merged 1 commit intoNVIDIA:mainfrom
ericniebler:safer-completion-signatures-of-t

Conversation

@ericniebler
Copy link
Copy Markdown
Collaborator

currently, the definition of the __completion_signatures_of_t alias is:

  using __completion_signatures_of_t =
    decltype(STDEXEC::get_completion_signatures<_Sender, _Env...>());

the trouble with this is that if get_completion_signatures exits with a compile-time exception, that error is lost, and we end up aliasing the declared return type of get_completion_signatures, aka completion_signatures<>.

a better definition looks like

  using __completion_signatures_of_t =
    __mtypeof<STDEXEC::get_completion_signatures<_Sender, _Env...>()>;

where __mtypeof is simply:

template <auto V>
using __mtypeof = decltype(V);

this causes __completion_signatures_of_t to SFINAE when the call to get_completion_signatures is not a constant expression.

@ericniebler ericniebler force-pushed the safer-completion-signatures-of-t branch 2 times, most recently from 4a2f36b to 85aaed4 Compare March 2, 2026 23:29
@ericniebler ericniebler force-pushed the safer-completion-signatures-of-t branch 2 times, most recently from f5b9334 to 0fb7416 Compare April 4, 2026 16:39
@ericniebler ericniebler force-pushed the safer-completion-signatures-of-t branch from 0fb7416 to a231981 Compare April 29, 2026 20:52
@ericniebler ericniebler merged commit 2b221c2 into NVIDIA:main Apr 29, 2026
32 checks passed
@ericniebler ericniebler deleted the safer-completion-signatures-of-t branch April 29, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant